//package com.xuecheng.media;
//
//import com.xuecheng.media.config.threadpool.*;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary;
//
//import java.util.concurrent.ThreadPoolExecutor;
//
//@Configuration
//public class ThreadPoolTestConfiguration {
//
//    @Bean
//    @Primary
//    public ThreadPoolAutoConfiguration.NamingThreadFactory namingThreadFactory() {
//        return new ThreadPoolAutoConfiguration.NamingThreadFactory("test-thread-");
//    }
//
//    @Bean
//    public ThreadPoolAutoConfiguration.ThreadPoolProperties threadPoolProperties() {
//        ThreadPoolAutoConfiguration.ThreadPoolProperties props = new ThreadPoolAutoConfiguration.ThreadPoolProperties();
//        props.setCoreSize(2);
//        props.setMaxSize(4);
//        props.setQueueCapacity(5);
//        props.setAllowCoreThreadTimeout(true);
//        props.setWaitForTasksCompleteOnShutdown(true);
//        return props;
//    }
//
////    @Bean
////    public DynamicThreadPoolAdjuster dynamicThreadPoolAdjuster(
////            ThreadPoolExecutor threadPoolExecutor,
////            ThreadPoolAutoConfiguration.ThreadPoolProperties properties) {
////        return new DynamicThreadPoolAdjuster(threadPoolExecutor, properties);
////    }
//
//    @Bean
//    public ThreadPoolMetrics threadPoolMetrics(
//            ThreadPoolExecutor threadPoolExecutor) {
//        return new ThreadPoolMetrics(threadPoolExecutor);
//    }
//}